{extend name="public/layout"/}
{block name="main"}
<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class="layui-this">{:lang('publish')}</li>
    </ul>
    <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
            <form class="layui-form" method="post">
                {:token()}
                <div class="layui-form-item">
                    <label class="layui-form-label">{:lang('publish')}</label>
                    <div class="layui-input-block">
                        <select lay-filter="filter">
                            <option value="{:url('publish','step=2')}">{:lang('SelectCategory')}</option>
                            {$categoryselect|raw}
                        </select>
                    </div>
                    <div class="layui-form-mid2 layui-word-aux">请先选择栏目(阴影的表示没有权限)，选择栏目后页面会刷新。</div>
                </div>
                {include file="inputItem" /}
                {if isset($fieldList) && count($fieldList)}
                <input type="hidden" name="modelField[catid]" value="{$catid}">
                <input type="hidden" name="modelFieldExt[site_id]" value="{$siteId}">

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit data-type="layui-form" data-refresh="true">{:lang('submit')}</button>
                    </div>
                </div>
                {/if}
            </form>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
layui.use(['form','yznForm'], function() {
    var form = layui.form,
    yznForm = layui.yznForm;

    yznForm.listen();
    form.on('select(filter)', function(data) {
        location.href = data.value
    });
});

//自己添加主题
$(function(){
    var theme = $('#theme').val();
    if (!theme){
        $('#title').bind('input propertychange', function() {
            var title = $('#title').val();
            $('#theme').val(title);
        });
    }
});
</script>
{/block}